import java.util.Comparator;
import java.util.TreeMap;

public class TreeMapDemo {
    public static void main(String[] args) {
   TreeMap<Integer, String> tm = new TreeMap<>(new Comparator<Integer>(){
       @Override
       public int compare(Integer o1,Integer o2){
           return o1-o2;

       }
   });
        tm.put(1,"wos");
        tm.put(2,"skoq");
        tm.put(3,"九个");
        tm.put(4,"可哈哈哈");
        System.out.println(tm);
   }
    }
